<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<!--[if lt IE 9]>
<script type="text/javascript" src="/static/lib/html5shiv.js"></script>
<script type="text/javascript" src="/static/lib/respond.min.js"></script>
<![endif]-->
<link rel="stylesheet" type="text/css" href="/static/h-ui/css/H-ui.min.css" />
<link rel="stylesheet" type="text/css" href="/static/h-ui.admin/css/H-ui.admin.css" />
<link rel="stylesheet" type="text/css" href="/static/lib/Hui-iconfont/1.0.8/iconfont.css" />
<link rel="stylesheet" type="text/css" href="/static/h-ui.admin/skin/default/skin.css" id="skin" />
<link rel="stylesheet" type="text/css" href="/static/h-ui.admin/css/style.css" />
    <script type="text/javascript" src="/static/lib/jquery/1.9.1/jquery.min.js"></script>
<!--[if IE 6]>
<script type="text/javascript" src="/static/lib/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
<title>用户详情</title>
<link href="/static/lib/webuploader/0.1.5/webuploader.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form action="{{ url('operation:add_library') }}" method="post" id="form" enctype="multipart/form-data">
    {{ input_csrf }}
<div class="page-container">
       <div class="row cl">
			<label class="form-label col-xs-4 col-sm-2">封面图：</label>
			<div class="formControls col-xs-8 col-sm-9">
　　       <div id="test-image-preview"></div>
                <input type="file" name="cover">
			</div>
		</div>

        <div class="row cl">
			<label class="form-label col-xs-4 col-sm-2">书名：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="" placeholder="" id="name" name="name">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2">作者：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="" placeholder="" id="author" name="author">
			</div>
		</div>
        <div class="row cl">
			<label class="form-label col-xs-4 col-sm-2">分类：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="" placeholder="" id="bussiness_jing" name="category" >
			</div>
		</div>
        <div class="row cl">
                <label class="form-label col-xs-4 col-sm-2">出版时间：</label>
                <div class="formControls col-xs-8 col-sm-9">
                    <input type="text" class="input-text" value="" placeholder="" id="publish_time" name="publish_time">
                </div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2">出版社：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="" placeholder="" id="publish_house" name="public_house">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2">页数：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="number" class="input-number" value="" placeholder="" id="page_count" name="page_count">
			</div>
		</div>
        <div class="row cl">
			<label class="form-label col-xs-4 col-sm-2">藏书量：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="" placeholder="" id="collect_count" name="collect_count">
			</div>
		</div>
        <div class="row cl">
			<label class="form-label col-xs-4 col-sm-2">剩余量：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="" placeholder="" id="remain_count" name="remain_count">
			</div>
		</div>
        <div class="row cl">
			<label class="form-label col-xs-4 col-sm-2">ISBN：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="" placeholder="" id="ISBN" name="ISBN">
			</div>
		</div>
        <div class="row cl">
			<label class="form-label col-xs-4 col-sm-2">添加时间：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="" placeholder="" id="add_time" name="add_time">
			</div>
		</div>
        <div class="row cl">
			<label class="form-label col-xs-4 col-sm-2">内容简介：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<textarea name="content_introduction"></textarea>
			</div>
		</div>
        <div class="row cl">
			<label class="form-label col-xs-4 col-sm-2">作者简介：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<textarea name="author_introduction"></textarea>
			</div>
		</div>
        <div class="row cl">
			<label class="form-label col-xs-4 col-sm-2">目录：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<textarea name="directory"></textarea>
			</div>
		</div>

        <div class="row cl">
			<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2">
				<button type="submit" class="btn btn-primary radius" id="btn"><i class="Hui-iconfont">&#xe632;</i>  添加 </button>
			</div>
		</div>
</div>
</form>

<script>
{#    var name = "{{ userinfo.name }}"#}
{#    var phonenumber = "{{ userinfo.phonenumber }}"#}
{#    function layer_close() {#}
{#        document.getElementById('name').value = name;#}
{#        document.getElementById('phonenumber').value = phonenumber;#}
{#    }#}
{#    function do_change() {#}
{#        document.getElementById('form').submit();#}
{#    }#}
</script>


<!--_footer 作为公共模版分离出去-->


<script type="text/javascript">
      $(function(){
          $("#test-image-file1").val("https://imgsa.baidu.com/exp/w=480/sign=581bd10a0bf3d7ca0cf63e7ec21fbe3c/cb8065380cd7912357e40240aa345982b2b780fa.jpg")
      })

      $("#btn").click(function () {
           var imgurl = document.getElementById("test-image-file1").files[0];
           var form = new FormData();
           form.append("business_id",$("#business_id").val());
           form.append("imgurl",imgurl);
           form.append("bussiness_style",$("#bussiness_style").val());
           form.append("bond_money",$("#bond_money").val());
           form.append("bussiness_name",$("#bussiness_name").val());
           form.append("bussiness_phone",$("#bussiness_phone").val());
           form.append("bussiness_way",$("#bussiness_way").val());
           form.append("bussiness_jing",$("#bussiness_jing").val());
           form.append("bussiness_wei",$("#bussiness_wei").val());
           form.append("bussiness_pu",$("#bussiness_pu").val());
           form.append("bussiness_dala",$("#bussiness_dala").val());
           form.append("bussiness_bonus",$("#bussiness_bonus").val());
　      $.ajax({
                url:"/operation/bussiness_add/",
                type:"post",
                data:form,
                processData:false,
                contentType:false,
                success:function(data){
                    window.location.href="/operation/bussiness_list/?id="+data;
                }
            });

         })
</script>
</body>
</html>